package com.gollum.common.enums;

import com.gollum.common.utils.StringUtils;

/**
 * 操作状态
 *
 * @author Herther
 * @version 1.0.0
 * @createTime 2022年09月04日 23:00:00
 */
public enum Operator{


    SUCCESS("0", "操作成功"){
        @Override
        public Boolean isStatus(String value){
            return StringUtils.equals(value, SUCCESS.value);
        }
    },

    ERROR("1", "操作失败"){
        @Override
        public Boolean isStatus(String value){
            return StringUtils.equals(value, ERROR.value);
        }
    },
    UNKNOWN("2","未知"){
        @Override
        public Boolean isStatus(String value){
            return StringUtils.equals(value, UNKNOWN.value);
        }
    };


    private String value;
    private String name;

    public abstract Boolean isStatus(String value);

    Operator(String value,String name){
        this.value =value;
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public String getName() {
        return name;
    }



}
